//package invest.strategy.impl;
//
//import invest.data.DataEnum;
//import invest.data.DataFactory;
//import invest.pojo.ToSendRecord;
//import invest.pojo.datapojo.ResearchReport;
//import invest.utils.DateUtil;
//import org.springframework.stereotype.Component;
//
//import java.util.Date;
//import java.util.List;
//
//@Component
//public class ResearchReposrtFind extends AbstractStrategy {
//    DataFactory dataFactory = new DataFactory();
//    {
//        super.cron = "0 30 9 ? * *";
//    }
//    @Override
//    protected void setMail() {
//        mail.setSubject("搜寻研报");
//        mail.setContent("查找研报评级买入并且有不少于10家机构评级");
//    }
//
//    @Override
//    public boolean analyzeStrategy() throws Exception {
//        boolean flag = false;
//        List<ResearchReport> researchReports = (List<ResearchReport>) dataFactory.getData(DataEnum.RESEARCHREPORT);
//        this.setInpireMailDays(5);
//        for (ResearchReport r : researchReports
//        ) {
//            boolean newData = DateUtil.getDayDiffer(r.getPublishDate(), new Date()) <= 3;
//            if (newData && r.getEmRatingName().equals("买入") && r.getCount() > 9) {
//                ToSendRecord record = new ToSendRecord();
//                record.setName(r.getStockName());
//                record.setMessage("评级买入机构的数量："+r.getCount());
//                this.setToSendTarget(record);
//                flag = true;
//            }
//        }
//        return flag;
//    }
//}
